home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / madtrb11.zip / TIME.INC < prev    next >
Text File  |  1985-08-05  |  534b  |  25 lines

  1. {
  2. FUNCTION Time
  3.  
  4. Source: "TIME: A Function To Measure Elapsed Time", TUG Lines Volume I Issue 3
  5. Author: Herb Holden
  6. Application: PC-DOS/MS-DOS
  7. }
  8.  
  9.  
  10. Function time: real  ;  (* HLH 6/6/84 *)
  11. Type registers = record
  12.                  ax,bx,cx,dx:  integer
  13.                  end ;
  14.  
  15. var r:registers ;
  16. begin
  17.   r.ax := $2C00 ;
  18.   intr($21,r) ;
  19.   with r do
  20.     time:= (cx shr 8)*3600+(cx and $00FF  )*60
  21.           +(dx shr 8)     +(dx and $00FF) /100 ;
  22. end;
  23.  
  24. {Note: cx and $00FF is substantially faster than cx mod 256!}
  25.